// vite.config.ts
import { fileURLToPath, URL } from "node:url";

import { defineConfig } from "vite";
import vue from "@vitejs/plugin-vue";
import vueJsx from "@vitejs/plugin-vue-jsx";
import Components from 'unplugin-vue-components/vite'; // +++++++
import { VantResolver } from 'unplugin-vue-components/resolvers';  // +++++++

// https://vitejs.dev/config/
export default defineConfig({
  plugins: [
    vue(), 
    vueJsx(),
    Components({  // +++++++
      resolvers: [VantResolver()],
    })
  ],
  resolve: {
    alias: {
      "@": fileURLToPath(new URL("./src", import.meta.url)),
    },
  },

server: {
  port: 9090,
  proxy: {
    "/api": {
      target:'http://waimai.yantianfeng.com',
      changeOrigin:true,//开启跨域
    }
  }
}

});
